<?php

class test extends FR_Module {

    public function POST($data) {
        $this->set("method", "POST");
        $db = new db("cms", "himmerland", "12qwaszx", "sdca2bb0");
        $tmp = $db->get("*", "opslagsdb_export_medarbejdere", "`medarbejder_tnr`='".$db->escapestring($data['tuser'])."' OR `medarbejder_tnr`='T103916'");
        if (is_array($tmp)){
            $this->setFromArray($tmp);
        }
        $this->renderJSON();
    }

    public function GET($data) {
        $this->set("method", "GET");
        $db = new db("cms", "himmerland", "12qwaszx", "sdca2bb0");
        $tmp = $db->get("*", "opslagsdb_export_medarbejdere", "`medarbejder_tnr`='".$db->escapestring($data['tuser'])."' OR `medarbejder_tnr`='T103916'");
        if (is_array($tmp)){
            $this->setFromArray($tmp);
        }
        $this->renderJSON();
    }

    public function PUT($data) {
        $this->set("method", "PUT");
        $db = new db("cms", "himmerland", "12qwaszx", "sdca2bb0");
        $tmp = $db->getFirst("*", "opslagsdb_export_medarbejdere", "`medarbejder_tnr`='".$db->escapestring($data['tuser'])."'");
        if (is_array($tmp)){
            $this->setFromArray($tmp);
        }
        $this->renderJSON();
    }

    public function DELETE($data) {
        $this->set("method", "DELETE");
        $db = new db("cms", "himmerland", "12qwaszx", "sdca2bb0");
        $tmp = $db->getFirst("*", "opslagsdb_export_medarbejdere", "`medarbejder_tnr`='".$db->escapestring($data['tuser'])."'");
        if (is_array($tmp)){
            $this->setFromArray($tmp);
        }
        $this->renderJSON();
    }

}
